<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: SD Host      (SD Host Controller)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__sd__host.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a>  </div>
  <div class="headertitle">
<div class="title">SD Host (SD Host Controller)</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This driver provides the user an easy method for accessing standard Host Controller Interface (HCI) registers and provides some simple functionality on top of the HCI for reading and writing data to an SD card, eMMc card or a SDIO device. </p>
<p>The functions and other declarations used in this driver are in cy_sd_host.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.</p>
<p>Features:</p><ul>
<li>Supports data transfer using CPU, SDMA, ADMA2 and ADMA3 modes</li>
<li>Supports a configurable block size (1 to 65,535 Bytes)</li>
<li>Supports interrupt enabling and masking</li>
<li>Supports SD-HCI Host version 4 mode or less</li>
<li>Compliant with the SD 6.0, SDIO 4.10 and eMMC 5.1 specifications and earlier versions</li>
<li>SD interface features:</li>
<li>- Supports the 4-bit interface</li>
<li>- Supports Ultra High Speed (UHS-I) mode</li>
<li>- Supports Default Speed (DS), High Speed (HS), SDR12, SDR25, SDR50, and DDR50 speed modes</li>
<li>- Supports SDIO card interrupts in both 1-bit and 4-bit modes</li>
<li>- Supports Standard capacity (SDSC), High capacity (SDHC) and Extended capacity (SDXC) memory</li>
<li>- Supports CRC and check for command and data packets</li>
<li>- Supports packet timeouts</li>
<li>- Handles the SDIO card interrupt</li>
<li>eMMC interface features:</li>
<li>- Supports 1-bit/4-bit/8-bit interfaces</li>
<li>- Supports legacy and High Speed SDR speed modes</li>
<li>- Supports CRC and check for command and data packets</li>
<li>- Supports packet timeouts</li>
</ul>
<p>Unsupported Features:</p><ul>
<li>Wrap address transfers</li>
<li>eMMC boot operation</li>
<li>Suspend/Resume operation in an SDIO card</li>
<li>Operation in SDR104, UHS-II mode, HS200, and HS400</li>
<li>Serial Peripheral Interface (SPI) protocol mode</li>
<li>Interrupt input pins for the embedded SD system</li>
<li>Auto-tuning</li>
<li>Command queuing</li>
</ul>
<p>The SD, eMMC, and SDIO cards have the similar physical interface: clock, command line, and data lines. The SD card is removable and requires the SD card connector to connect to the PSoC device. This connector also has the card_mech_write_prot switch for mechanical write protection and the card_detect_n switch for card detection. The eMMC card also has DAT4-DAT7 pins for 8-bit mode and the EMMC_RESET pin. </p><div class="image">
<img src="sd_card_connector.png" alt="sd_card_connector.png"/>
</div>
<p> The driver has a low-level and high-level APIs. The low-level functions provide an easy method to read and write registers. Also, these functions allow valid interaction with an SD Card, eMMC card, and SDIO card. The high-level functions provide an easy mechanism to enumerate a device, read, write, and erase data. They are RTOS-friendly. When starting a command, these functions do not wait until the command completes. The interrupt and flags are used to check when the transfer completes. This allows to put RTOS delays in the user code.</p>
<h1><a class="anchor" id="group_sd_host_section_Configuration_Considerations"></a>
Configuration Considerations</h1>
<p>The SD Host driver configuration can be divided to a number of sequential steps listed below:</p><ul>
<li><a class="el" href="group__group__sd__host.html#group_sd_host_enable">Enable SD Host</a></li>
<li><a class="el" href="group__group__sd__host.html#group_sd_host_pins">Assign and Configure Pins</a></li>
<li><a class="el" href="group__group__sd__host.html#group_sd_host_clock">Assign Clock Source</a></li>
<li><a class="el" href="group__group__sd__host.html#group_sd_host_intr">Configure Interrupt (Optional)</a></li>
<li><a class="el" href="group__group__sd__host.html#group_sd_host_config">Configure SD Host</a></li>
<li><a class="el" href="group__group__sd__host.html#group_sd_host_card_init">Initialize the card</a></li>
</ul>
<dl class="section note"><dt>Note</dt><dd>The SD Host driver is built on top of the SDHC hardware block. The SDHC1 instance is used as an example for all code snippets. Modify the code to match your design.</dd></dl>
<h2><a class="anchor" id="group_sd_host_enable"></a>
Enable SD Host</h2>
<p>Enable the SDHC block calling <a class="el" href="group__group__sd__host__low__level__functions.html#gad14bf4c715eaa282580d89bd2be1a420">Cy_SD_Host_Enable</a>.</p>
<h2><a class="anchor" id="group_sd_host_pins"></a>
Assign and Configure Pins</h2>
<p>Only dedicated SD Host pins can be used for SD Host operation. The HSIOM register must be configured to connect the block to the pins. Also, the SD Host pins must be configured in Strong Drive, Input buffer on:</p>
<div class="fragment"><div class="line"><span class="comment">/* Assign pins for SD Host on SDHC1 */</span></div><div class="line"><span class="preprocessor">#define SDHC1_PORT1   (P12_0_PORT)</span></div><div class="line"><span class="preprocessor">#define SDHC1_PORT2   (P13_0_PORT)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#define SDHC1_IO_VOLT_SEL_NUM           (P12_7_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_DETECT_N_NUM         (P12_1_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_MECH_WRITE_PROT_NUM  (P12_2_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_LED_CTRL_NUM              (P12_3_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_IF_PWR_EN_NUM        (P12_6_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_EMMC_RESET_N_NUM     (P12_0_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_CMD_NUM              (P12_4_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CLK_CARD_NUM              (P12_5_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_DAT_3TO00_NUM        (P13_0_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_DAT_3TO01_NUM        (P13_1_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_DAT_3TO02_NUM        (P13_2_NUM)</span></div><div class="line"><span class="preprocessor">#define SDHC1_CARD_DAT_3TO03_NUM        (P13_3_NUM)</span></div><div class="line"></div><div class="line"><span class="comment">/* Connect SD Host SDHC function to pins */</span></div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT1, SDHC1_IO_VOLT_SEL_NUM, P12_7_SDHC1_IO_VOLT_SEL);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT1, SDHC1_CARD_DETECT_N_NUM, P12_1_SDHC1_CARD_DETECT_N);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT1, SDHC1_CARD_MECH_WRITE_PROT_NUM, P12_2_SDHC1_CARD_MECH_WRITE_PROT);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT1, SDHC1_LED_CTRL_NUM, P12_3_SDHC1_LED_CTRL);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT1, SDHC1_CARD_IF_PWR_EN_NUM, P12_6_SDHC1_CARD_IF_PWR_EN);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT1, SDHC1_CARD_EMMC_RESET_N_NUM, P12_0_SDHC1_CARD_EMMC_RESET_N);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT1, SDHC1_CARD_CMD_NUM, P12_4_SDHC1_CARD_CMD);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT1, SDHC1_CLK_CARD_NUM, P12_5_SDHC1_CLK_CARD);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT2, SDHC1_CARD_DAT_3TO00_NUM, P13_0_SDHC1_CARD_DAT_3TO00);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT2, SDHC1_CARD_DAT_3TO01_NUM, P13_1_SDHC1_CARD_DAT_3TO01);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT2, SDHC1_CARD_DAT_3TO02_NUM, P13_2_SDHC1_CARD_DAT_3TO02);</div><div class="line"><a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(SDHC1_PORT2, SDHC1_CARD_DAT_3TO03_NUM, P13_3_SDHC1_CARD_DAT_3TO03);</div><div class="line"></div><div class="line"><span class="comment">/* Configure pins for SDHC operation */</span></div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT1, SDHC1_IO_VOLT_SEL_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT1, SDHC1_CARD_DETECT_N_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT1, SDHC1_CARD_MECH_WRITE_PROT_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT1, SDHC1_LED_CTRL_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT1, SDHC1_CARD_IF_PWR_EN_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT1, SDHC1_CARD_EMMC_RESET_N_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT1, SDHC1_CARD_CMD_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT1, SDHC1_CLK_CARD_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT2, SDHC1_CARD_DAT_3TO00_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT2, SDHC1_CARD_DAT_3TO01_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT2, SDHC1_CARD_DAT_3TO02_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"><a class="code" href="group__group__gpio__functions__gpio.html#ga97e64dc8c45e7cd73e3012100d03b1fd">Cy_GPIO_SetDrivemode</a>(SDHC1_PORT2, SDHC1_CARD_DAT_3TO03_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>);</div><div class="line"></div></div><!-- fragment --> <h2><a class="anchor" id="group_sd_host_clock"></a>
Assign Clock Source</h2>
<p>The SD Host is sourced from the CLK_HF clock. The clock must be set to 100 MHz:</p>
<div class="fragment"><div class="line"><span class="comment">/* Note: The CLK_HF2 input clock must be configured and enabled. */</span></div><div class="line"></div><div class="line"><span class="comment">/* Apply the CLK_HF2 divider to have CLK_HF2 = 100 MHz. */</span></div><div class="line"><a class="code" href="group__group__sysclk__clk__hf__funcs.html#ga2d39c7e5111f9ba0738f032a98b4593e">Cy_SysClk_ClkHfSetSource</a>(2u, <a class="code" href="group__group__sysclk__clk__hf__enums.html#ggabac2d6b9124a00860dcd781a922788d6ab67e691f04cd3aecb2a4cbf8bbd5b787">CY_SYSCLK_CLKHF_IN_CLKPATH0</a>);</div><div class="line"><a class="code" href="group__group__sysclk__clk__hf__funcs.html#ga66c6e94768403ab318f2aa321b4c1e50">Cy_SysClk_ClkHfSetDivider</a>(2u, <a class="code" href="group__group__sysclk__clk__hf__enums.html#ggadfbf0caf87af7cd757648124fb17d1d4a996f9d53d3d78eda51e71dd65b1990c0">CY_SYSCLK_CLKHF_NO_DIVIDE</a>);</div><div class="line"><a class="code" href="group__group__sysclk__clk__hf__funcs.html#gaf3041fc8333478cc7c8d869d2a535d71">Cy_SysClk_ClkHfEnable</a>(2u);</div></div><!-- fragment --> <h2><a class="anchor" id="group_sd_host_intr"></a>
Configure Interrupt (Optional)</h2>
<p>The user can set up the interrupt for SD Host operation. The user is responsible for writing its own Interrupt handler. The Interrupt must be called in the interrupt handler for the selected SDHC instance. Also this interrupt must be enabled in the NVIC otherwise it will not work. It is the user's responsibility to clear the normal and error interrupt statuses. The interrupt statuses can be read using <a class="el" href="group__group__sd__host__interrupt__functions.html#gad4a09951afc276a483c93e5e158528f3">Cy_SD_Host_GetNormalInterruptStatus</a> and <a class="el" href="group__group__sd__host__interrupt__functions.html#ga41fa86242b7f84442e589055d3130f03">Cy_SD_Host_GetErrorInterruptStatus</a>. To clear the interrupt statuses, use <a class="el" href="group__group__sd__host__interrupt__functions.html#ga95975e199a0669a600e2fe5ada69b892">Cy_SD_Host_ClearNormalInterruptStatus</a> and <a class="el" href="group__group__sd__host__interrupt__functions.html#ga1ade65f4d6a71808cf12a4b0957213a1">Cy_SD_Host_ClearErrorInterruptStatus</a>.</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> SD_Host_User_Isr(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line">    uint32_t normalStatus;</div><div class="line">    uint32_t errorStatus;</div><div class="line">   </div><div class="line">    normalStatus = <a class="code" href="group__group__sd__host__interrupt__functions.html#gad4a09951afc276a483c93e5e158528f3">Cy_SD_Host_GetNormalInterruptStatus</a>(SDHC1);</div><div class="line"></div><div class="line">    <span class="comment">/* Check the Error event */</span></div><div class="line">    <span class="keywordflow">if</span> (0u &lt; normalStatus)</div><div class="line">    {</div><div class="line">        <span class="comment">/* Clear the normalStatus event */</span></div><div class="line">        <a class="code" href="group__group__sd__host__interrupt__functions.html#ga95975e199a0669a600e2fe5ada69b892">Cy_SD_Host_ClearNormalInterruptStatus</a>(SDHC1, normalStatus);</div><div class="line">    }</div><div class="line">   </div><div class="line">    errorStatus = <a class="code" href="group__group__sd__host__interrupt__functions.html#ga41fa86242b7f84442e589055d3130f03">Cy_SD_Host_GetErrorInterruptStatus</a>(SDHC1);</div><div class="line"></div><div class="line">    <span class="comment">/* Check the Error event */</span></div><div class="line">    <span class="keywordflow">if</span> (0u &lt; errorStatus)</div><div class="line">    {</div><div class="line">        <span class="comment">/* Clear the Error event */</span></div><div class="line">        <a class="code" href="group__group__sd__host__interrupt__functions.html#ga1ade65f4d6a71808cf12a4b0957213a1">Cy_SD_Host_ClearErrorInterruptStatus</a>(SDHC1, errorStatus);</div><div class="line">    }</div><div class="line">    </div><div class="line">    <span class="comment">/* Add the use code here. */</span></div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="comment">/* Assign SDHC1 interrupt number and priority */</span></div><div class="line"><span class="preprocessor">#define SD_Host_INTR_NUM        sdhc_1_interrupt_general_IRQn</span></div><div class="line"><span class="preprocessor">#define SD_Host_INTR_PRIORITY   (3UL)</span></div><div class="line"></div><div class="line"><span class="comment">/* Populate configuration structure (code specific for CM4) */</span></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__sysint__t.html">cy_stc_sysint_t</a> sdHostIntrConfig =</div><div class="line">{</div><div class="line"><span class="preprocessor">            #if (CY_CPU_CORTEX_M0P)</span></div><div class="line">                 <span class="comment">/* .intrSrc */</span> NvicMux4_IRQn,</div><div class="line">                <span class="comment">/* .cm0pSrc */</span> SD_Host_INTR_NUM,</div><div class="line"><span class="preprocessor">            #else</span></div><div class="line">                 <span class="comment">/* .intrSrc */</span> SD_Host_INTR_NUM, <span class="comment">/* SD Host interrupt number (non M0 core)*/</span></div><div class="line"><span class="preprocessor">            #endif</span></div><div class="line">        <span class="comment">/* .intrPriority */</span> SD_Host_INTR_PRIORITY</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">/* Generate an interrupt on SD card insertion or removal */</span></div><div class="line"><a class="code" href="group__group__sd__host__interrupt__functions.html#ga68be9275fdb737ae903b43253e24d88d">Cy_SD_Host_SetNormalInterruptMask</a>(SDHC1, (<a class="code" href="group__group__sd__host__macros__events.html#ga90d17070d26c810dc05d7460ce90385c">CY_SD_HOST_CARD_INSERTION</a> | <a class="code" href="group__group__sd__host__macros__events.html#gae16d282c2c5e26342e051ce0cd01f215">CY_SD_HOST_CARD_REMOVAL</a>));</div><div class="line"></div><div class="line"><span class="comment">/* Enable global interrupts. */</span></div><div class="line">__enable_irq();</div><div class="line"></div><div class="line"><span class="comment">/* Hook interrupt service routine and enable interrupt */</span></div><div class="line">(void) <a class="code" href="group__group__sysint__functions.html#gab2ff6820a898e9af3f780000054eea5d">Cy_SysInt_Init</a>(&amp;sdHostIntrConfig, &amp;SD_Host_User_Isr);</div><div class="line"><span class="preprocessor">#if (CY_CPU_CORTEX_M0P)</span></div><div class="line">    NVIC_EnableIRQ(NvicMux4_IRQn);</div><div class="line"><span class="preprocessor">#else</span></div><div class="line">    NVIC_EnableIRQ(SD_Host_INTR_NUM);</div><div class="line"><span class="preprocessor">#endif</span></div></div><!-- fragment --> <h2><a class="anchor" id="group_sd_host_config"></a>
Configure SD Host</h2>
<p>To set up the SD Host driver, provide the configuration parameters in the <a class="el" href="structcy__stc__sd__host__init__config__t.html">cy_stc_sd_host_init_config_t</a> structure. Set the emmc parameter to true for the eMMC-device, otherwise set it to false. Set dmaType if DMA mode is used for read/write operations. The other parameters are optional for operation. To initialize the driver, call the <a class="el" href="group__group__sd__host__low__level__functions.html#ga7e46a2df218aebc23faac7acdf5260da">Cy_SD_Host_Init</a> function providing a pointer to the filled <a class="el" href="structcy__stc__sd__host__init__config__t.html">cy_stc_sd_host_init_config_t</a> structure and allocated <a class="el" href="structcy__stc__sd__host__context__t.html">cy_stc_sd_host_context_t</a>.</p>
<div class="fragment"><div class="line"><span class="comment">/* Allocate context for SD Host operation */</span></div><div class="line"><a class="code" href="structcy__stc__sd__host__context__t.html">cy_stc_sd_host_context_t</a> sdHostContext;</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="comment">/* Populate configuration structure */</span></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__sd__host__init__config__t.html">cy_stc_sd_host_init_config_t</a> sdHostConfig = </div><div class="line">{ </div><div class="line">    .<a class="code" href="structcy__stc__sd__host__init__config__t.html#a132f14b1297b311f78e372dbcbcd9037">dmaType</a> = <a class="code" href="group__group__sd__host__enums.html#gga85f11aeea7e99ea8e0e14fcb468c2f0ea899274bd9813af05f50cda0607413c13">CY_SD_HOST_DMA_ADMA2</a>, </div><div class="line">    .enableLedControl = <span class="keyword">false</span>, </div><div class="line">    .emmc = <span class="keyword">false</span>, </div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">/* Configure SD Host to operate */</span></div><div class="line">(void) <a class="code" href="group__group__sd__host__low__level__functions.html#ga7e46a2df218aebc23faac7acdf5260da">Cy_SD_Host_Init</a>(SDHC1, &amp;sdHostConfig, &amp;sdHostContext);</div></div><!-- fragment --><p> The SD, eMMC or SDIO card can be configured using the <a class="el" href="group__group__sd__host__high__level__functions.html#ga9d72dcc2426210eef77fa5b95eefb986">Cy_SD_Host_InitCard</a> function as a pointer to the filled <a class="el" href="structcy__stc__sd__host__sd__card__config__t.html">cy_stc_sd_host_sd_card_config_t</a> structure and allocated <a class="el" href="structcy__stc__sd__host__context__t.html">cy_stc_sd_host_context_t</a>.</p>
<h2><a class="anchor" id="group_sd_host_card_init"></a>
Initialize the card</h2>
<p>Finally, enable the card operation calling <a class="el" href="group__group__sd__host__high__level__functions.html#ga9d72dcc2426210eef77fa5b95eefb986">Cy_SD_Host_InitCard</a>.</p>
<div class="fragment"><div class="line"><a class="code" href="group__group__sd__host__enums.html#ga87f2b92ae670074b0123e47660ab0ba3">cy_en_sd_host_card_type_t</a> cardType;</div><div class="line">uint32_t rca;</div><div class="line"><a class="code" href="group__group__sd__host__enums.html#gad6477d79dba547af8ce5e80bcf670d38">cy_en_sd_host_card_capacity_t</a> cardCapacity;</div><div class="line"></div><div class="line"><span class="comment">/* Populate configuration structure */</span></div><div class="line"><a class="code" href="structcy__stc__sd__host__sd__card__config__t.html">cy_stc_sd_host_sd_card_config_t</a> sdCardConfig = </div><div class="line">{ </div><div class="line">    .<a class="code" href="structcy__stc__sd__host__sd__card__config__t.html#a100a6eaaadfd0c1736c8d3331a0f3d8b">lowVoltageSignaling</a> = <span class="keyword">false</span>,</div><div class="line">    .busWidth = <a class="code" href="group__group__sd__host__enums.html#ggaa37e16176a2e632a2ca02028f447a9ebac5f777554dafb8df5cb02d7962f2d4b5">CY_SD_HOST_BUS_WIDTH_4_BIT</a>,</div><div class="line">    .cardType = &amp;cardType,</div><div class="line">    .rca = &amp;rca,</div><div class="line">    .cardCapacity = &amp;cardCapacity,</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">/* Initialize the card */</span></div><div class="line">(void) <a class="code" href="group__group__sd__host__high__level__functions.html#ga9d72dcc2426210eef77fa5b95eefb986">Cy_SD_Host_InitCard</a>(SDHC1, &amp;sdCardConfig, &amp;sdHostContext);</div></div><!-- fragment --> <h1><a class="anchor" id="group_sd_host_use_cases"></a>
Common Use Cases</h1>
<h2><a class="anchor" id="group_sd_host_sd_card_mode"></a>
SD card Operation</h2>
<p>The master API is divided into two categories: <a class="el" href="group__group__sd__host__high__level__functions.html">High-Level</a> and <a class="el" href="group__group__sd__host__low__level__functions.html">Low-Level</a>. Therefore, there are two methods for initiating SD card transactions using either <b>Low-Level</b> or <b>High-Level</b> API.</p>
<h3><a class="anchor" id="group_sd_host_master_hl"></a>
Use High-Level Functions</h3>
<p>Call <a class="el" href="group__group__sd__host__high__level__functions.html#ga651eeea3b4c0a433db932db34ba7a222">Cy_SD_Host_Read</a> or <a class="el" href="group__group__sd__host__high__level__functions.html#gaacf4fbad1af632a2b7fe82980b15e8ae">Cy_SD_Host_Write</a> to communicate with the SD memory device. These functions do not block in DMA mode and only start a transaction. After a transaction starts, the user should check the further data-transaction complete event. The example below shows sending and reading data in DMA mode.</p>
<div class="fragment"><div class="line"></div><div class="line"><span class="comment">/* Note: SD Host and the card must be initialized in ADMA2 or SDMA</span></div><div class="line"><span class="comment"> * mode before using the code below.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="preprocessor">#define DATA       (7U)  </span><span class="comment">/* Data to write. */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><a class="code" href="structcy__stc__sd__host__write__read__config__t.html">cy_stc_sd_host_write_read_config_t</a> data;</div><div class="line"><a class="code" href="group__group__sd__host__enums.html#gabbf5bb6a131cd8b9c529b7e36b35fe23">cy_en_sd_host_status_t</a> ret;</div><div class="line">uint8_t rxBuff[<a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a>];   <span class="comment">/* Data to read. */</span></div><div class="line">uint8_t txBuff[<a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a>];   <span class="comment">/* Data to write. */</span></div><div class="line"></div><div class="line">memset(txBuff, DATA, <span class="keyword">sizeof</span>(txBuff));  <span class="comment">/* Fill the array with data to write. */</span></div><div class="line"></div><div class="line">data.<a class="code" href="structcy__stc__sd__host__write__read__config__t.html#abf986be07c8a00aa8e5394bf8f07f75b">address</a> = 0UL;         <span class="comment">/* The address to write/read data on the card or eMMC. */</span></div><div class="line">data.<a class="code" href="structcy__stc__sd__host__write__read__config__t.html#afb2db28564aeaba887f381418f712af5">numberOfBlocks</a> = 1UL;  <span class="comment">/* The number of blocks to write/read (Single block write/read). */</span></div><div class="line">data.<a class="code" href="structcy__stc__sd__host__write__read__config__t.html#ad3deb9b66da477a4db770342d9c53a6c">autoCommand</a> = <a class="code" href="group__group__sd__host__enums.html#gga6d2439309c4364371d8384781c5c8ba1a31e0ddddd86a6975c4a8f4722dce9c41">CY_SD_HOST_AUTO_CMD_NONE</a>;  <span class="comment">/* Selects which auto commands are used if any. */</span></div><div class="line">data.<a class="code" href="structcy__stc__sd__host__write__read__config__t.html#a2ea0bb37933eee1d464ede9550f78f06">dataTimeout</a> = 12UL;     <span class="comment">/* The timeout value for the transfer. */</span></div><div class="line">data.<a class="code" href="structcy__stc__sd__host__write__read__config__t.html#a7b4f7370439a96123843e4b1433672b6">enReliableWrite</a> = <span class="keyword">false</span>; <span class="comment">/* For EMMC cards enable reliable write. */</span></div><div class="line">data.<a class="code" href="structcy__stc__sd__host__write__read__config__t.html#abe4883ca2cfbcc2a2ffe01ad99bd4f99">enableDma</a> = <span class="keyword">true</span>;  <span class="comment">/* Enable DMA mode. */</span></div><div class="line"></div><div class="line">data.<a class="code" href="structcy__stc__sd__host__write__read__config__t.html#af2db79e86da5f8aad3b0f9c8f5809968">data</a> = (uint32_t*)txBuff;  <span class="comment">/* The pointer to data to write. */</span></div><div class="line">ret = <a class="code" href="group__group__sd__host__high__level__functions.html#gaacf4fbad1af632a2b7fe82980b15e8ae">Cy_SD_Host_Write</a>(SDHC1, &amp;data, &amp;sdHostContext);  <span class="comment">/* Write data to the card. */</span></div><div class="line"></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__sd__host__enums.html#ggabbf5bb6a131cd8b9c529b7e36b35fe23a4e18e8a352565d91021540b73af0d545">CY_SD_HOST_SUCCESS</a> == ret)</div><div class="line">{</div><div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group__group__sd__host__macros__events.html#gac8e73e3d93e68fd372ea1608f9d3ac7e">CY_SD_HOST_XFER_COMPLETE</a> != (<a class="code" href="group__group__sd__host__interrupt__functions.html#gad4a09951afc276a483c93e5e158528f3">Cy_SD_Host_GetNormalInterruptStatus</a>(SDHC1) &amp; <a class="code" href="group__group__sd__host__macros__events.html#gac8e73e3d93e68fd372ea1608f9d3ac7e">CY_SD_HOST_XFER_COMPLETE</a>))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Wait for the data-transaction complete event. */</span></div><div class="line">    }</div><div class="line">}</div><div class="line"></div><div class="line">data.<a class="code" href="structcy__stc__sd__host__write__read__config__t.html#af2db79e86da5f8aad3b0f9c8f5809968">data</a> = (uint32_t*)rxBuff;  <span class="comment">/* The pointer to data to read. */</span></div><div class="line">ret = <a class="code" href="group__group__sd__host__high__level__functions.html#ga651eeea3b4c0a433db932db34ba7a222">Cy_SD_Host_Read</a>(SDHC1, &amp;data, &amp;sdHostContext);   <span class="comment">/* Read data from the card. */</span></div><div class="line"></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__sd__host__enums.html#ggabbf5bb6a131cd8b9c529b7e36b35fe23a4e18e8a352565d91021540b73af0d545">CY_SD_HOST_SUCCESS</a> == ret)</div><div class="line">{</div><div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group__group__sd__host__macros__events.html#gac8e73e3d93e68fd372ea1608f9d3ac7e">CY_SD_HOST_XFER_COMPLETE</a> != (<a class="code" href="group__group__sd__host__interrupt__functions.html#gad4a09951afc276a483c93e5e158528f3">Cy_SD_Host_GetNormalInterruptStatus</a>(SDHC1) &amp; <a class="code" href="group__group__sd__host__macros__events.html#gac8e73e3d93e68fd372ea1608f9d3ac7e">CY_SD_HOST_XFER_COMPLETE</a>))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Wait for the data-transaction complete event. */</span></div><div class="line">    }</div><div class="line">    </div><div class="line">    <span class="comment">/* Clear the data-transaction complete event. */</span></div><div class="line">    <a class="code" href="group__group__sd__host__interrupt__functions.html#ga95975e199a0669a600e2fe5ada69b892">Cy_SD_Host_ClearNormalInterruptStatus</a>(SDHC1, CY_SD_HOST_XFER_COMPLETE);</div><div class="line">}</div></div><!-- fragment --> <h3><a class="anchor" id="group_sd_host_master_ll"></a>
Use Low-Level Functions</h3>
<p>Call <a class="el" href="group__group__sd__host__low__level__functions.html#ga0bc6396147a2b2aa4915a2d1ef3677c1">Cy_SD_Host_InitDataTransfer</a> to initialize the SD block for a data transfer. It does not start a transfer. To start a transfer call <a class="el" href="group__group__sd__host__low__level__functions.html#ga98fe407a6f55d8d7ae0dd1c5defa41df">Cy_SD_Host_SendCommand</a> after calling this function. If DMA is not used for Data transfer then the buffer needs to be filled with data first if this is a write. Wait the transfer complete event. ADMA3 mode requires calling <a class="el" href="group__group__sd__host__low__level__functions.html#ga0bc6396147a2b2aa4915a2d1ef3677c1">Cy_SD_Host_InitDataTransfer</a> to initialize the DMA transaction. The ADMA3 mode example is shown below.</p>
<div class="fragment"><div class="line"> <span class="comment">/* The code below demonstrates ADMA3 mode for writing</span></div><div class="line"><span class="comment">  * two buffers of data in two different addresses in</span></div><div class="line"><span class="comment">  * the card and reading data from the card into one buffer.</span></div><div class="line"><span class="comment">  * All these operations are performed using one DMA transaction.</span></div><div class="line"><span class="comment">  * Each Write buffer has the length of two blocks (1024 bytes).</span></div><div class="line"><span class="comment">  * The first txBuff_1 buffer contains 0x01 values and</span></div><div class="line"><span class="comment">  * the second txBuff_2 buffer contains 0x03 values.</span></div><div class="line"><span class="comment">  * The txBuff_1 data is written to the address = 0 using</span></div><div class="line"><span class="comment">  * the CMD25 command. The txBuff_2 data is written to</span></div><div class="line"><span class="comment">  * the address = 2 (or 1024 for SDSC cards) using the</span></div><div class="line"><span class="comment">  * CMD25 command. The Read buffer has the length of</span></div><div class="line"><span class="comment">  * four blocks (2048 bytes). The rxBuff data is read from</span></div><div class="line"><span class="comment">  * the address = 0 using the CMD18 command</span></div><div class="line"><span class="comment">  * (Read data should contain all data from two Write buffers).</span></div><div class="line"><span class="comment">  */</span></div><div class="line">  </div><div class="line"><span class="comment">/* Note: SD Host and the card must be initialized in ADMA3 mode before </span></div><div class="line"><span class="comment"> * using the code below.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"></div><div class="line"><span class="preprocessor">#define WR_BLOCK_NUM  (2UL)  </span><span class="comment">/* Number of blocks to write */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">#define RD_BLOCK_NUM  (4UL)  </span><span class="comment">/* Number of blocks to read */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">#define VALUE1  (0x1U)       </span><span class="comment">/* Value to write into first two blocks */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">#define VALUE2  (0x3U)       </span><span class="comment">/* Value to write into last two blocks */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><a class="code" href="group__group__sd__host__enums.html#gabbf5bb6a131cd8b9c529b7e36b35fe23">cy_en_sd_host_status_t</a> status;</div><div class="line">uint32_t integratedDescriptor[6];  <span class="comment">/* Integrated Descriptor */</span></div><div class="line">uint32_t cmdDescriptor0[10];       <span class="comment">/* Command Descriptor for CMD25 */</span></div><div class="line">uint32_t cmdDescriptor1[10];       <span class="comment">/* Command Descriptor for CMD25 */</span></div><div class="line">uint32_t cmdDescriptor2[10];       <span class="comment">/* Command Descriptor for CMD18 */</span></div><div class="line">uint8_t txBuff_1[<a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a>*WR_BLOCK_NUM]; <span class="comment">/* The first buffer to write data */</span></div><div class="line">uint8_t txBuff_2[<a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a>*WR_BLOCK_NUM]; <span class="comment">/* The second buffer to write data */</span></div><div class="line">uint8_t rxBuff[<a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a>*RD_BLOCK_NUM];   <span class="comment">/* The buffer to read data */</span></div><div class="line">uint32_t wrRdAddress = 0UL;               <span class="comment">/* Write Address 1 (and read address)*/</span></div><div class="line">uint32_t wrAddress2 = WR_BLOCK_NUM;       <span class="comment">/* Write Address 2 */</span></div><div class="line"><a class="code" href="structcy__stc__sd__host__data__config__t.html">cy_stc_sd_host_data_config_t</a> dataConfig;  <span class="comment">/* The data configuration structure */</span></div><div class="line"></div><div class="line"><span class="comment">/* Fill the buffers */</span></div><div class="line">memset(txBuff_1, VALUE1, <span class="keyword">sizeof</span>(txBuff_1));</div><div class="line">memset(txBuff_2, VALUE2, <span class="keyword">sizeof</span>(txBuff_2));</div><div class="line">memset(rxBuff, 0UL, <span class="keyword">sizeof</span>(rxBuff));</div><div class="line"></div><div class="line"><span class="comment">/* The SDSC cards have byte addressing. The SDHC/SDXC cards have block addressing.</span></div><div class="line"><span class="comment"> * The address should be multiplied by 512 for the SDSC cards.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__sd__host__enums.html#ggad6477d79dba547af8ce5e80bcf670d38aa84c68fb79b5f0da00d2511b66778330">CY_SD_HOST_SDSC</a> == sdHostContext.<a class="code" href="structcy__stc__sd__host__context__t.html#aaa077e5a82d855e044886094649f20bc">cardCapacity</a>)</div><div class="line">{</div><div class="line">    wrRdAddress = wrRdAddress &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga0e51990794723605d35915325d5e3ded">CY_SD_HOST_SDSC_ADDR_SHIFT</a>;</div><div class="line">    wrAddress2 = wrAddress2 &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga0e51990794723605d35915325d5e3ded">CY_SD_HOST_SDSC_ADDR_SHIFT</a>;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">/* Configure read/write structure. enableDma = true and</span></div><div class="line"><span class="comment"> * ADMA3 Integrated Descriptor Address are enough for ADMA3 mode.</span></div><div class="line"><span class="comment"> */</span></div><div class="line">dataConfig.<a class="code" href="structcy__stc__sd__host__data__config__t.html#a8c6205390c0288816bcf15adab9a5b0d">enableDma</a> = <span class="keyword">true</span>;</div><div class="line">dataConfig.<a class="code" href="structcy__stc__sd__host__data__config__t.html#a126a82e1490856db29d0289d7a4f7959">data</a> = (uint32_t*)&amp;integratedDescriptor[0];</div><div class="line"></div><div class="line"><span class="comment">/* Make sure that descriptors are empty */</span></div><div class="line">memset(integratedDescriptor, 0UL, <span class="keyword">sizeof</span>(integratedDescriptor));</div><div class="line">memset(cmdDescriptor0, 0UL, <span class="keyword">sizeof</span>(cmdDescriptor0));</div><div class="line">memset(cmdDescriptor1, 0UL, <span class="keyword">sizeof</span>(cmdDescriptor1));</div><div class="line">memset(cmdDescriptor2, 0UL, <span class="keyword">sizeof</span>(cmdDescriptor2));</div><div class="line"></div><div class="line"><span class="comment">/* The Integrated Descriptor */</span></div><div class="line">integratedDescriptor[0] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga2531216d2ab088e701ea0014d6d0af02">CY_SD_HOST_ADMA3_INTERGRATED</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;     <span class="comment">/* Len */</span></div><div class="line"></div><div class="line">integratedDescriptor[1] = (uint32_t)&amp;cmdDescriptor0[0];</div><div class="line"></div><div class="line">integratedDescriptor[2] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> | <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> | <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga2531216d2ab088e701ea0014d6d0af02">CY_SD_HOST_ADMA3_INTERGRATED</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;       <span class="comment">/* Len */</span></div><div class="line"></div><div class="line">integratedDescriptor[3] = (uint32_t)&amp;cmdDescriptor1[0];</div><div class="line"></div><div class="line">integratedDescriptor[4] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> | <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> | <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga2531216d2ab088e701ea0014d6d0af02">CY_SD_HOST_ADMA3_INTERGRATED</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;       <span class="comment">/* Len */</span></div><div class="line"></div><div class="line">integratedDescriptor[5] = (uint32_t)&amp;cmdDescriptor2[0];</div><div class="line"></div><div class="line"><span class="comment">/* The Command Descriptor for SD Mode - Write to first two blocks */</span></div><div class="line"></div><div class="line"><span class="comment">/* 32-bit Block Count */</span></div><div class="line">cmdDescriptor0[0] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line"></div><div class="line">cmdDescriptor0[1] = WR_BLOCK_NUM;   <span class="comment">/* number Of Block */</span></div><div class="line"></div><div class="line"><span class="comment">/* (16-bit Block Count) + Block Size */</span></div><div class="line">cmdDescriptor0[2] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor0[3] = <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a>;    <span class="comment">/* block Size */</span></div><div class="line"></div><div class="line"><span class="comment">/* Argument */</span></div><div class="line">cmdDescriptor0[4] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor0[5] = wrRdAddress;    <span class="comment">/* Write Address 1 */</span></div><div class="line"></div><div class="line"><span class="comment">/* Command + Transfer Mode */</span></div><div class="line">cmdDescriptor0[6] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor0[7] = 25UL &lt;&lt; (16U + 0x8U) |             <span class="comment">/* Command Index - CMD25 */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x5U) |               <span class="comment">/* Data Present Select */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x4U) |               <span class="comment">/* Index Check Enable */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x3U) |               <span class="comment">/* CRC Check Enable */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__enums.html#gga92601f3f191b87c5c9e43dfe08f19b06a061fb769dd73cbf0294d88d8d1e19407">CY_SD_HOST_RESPONSE_LEN_48</a> &lt;&lt; (16U + 0x0U) | <span class="comment">/* Response Type Select */</span></div><div class="line">                    1UL &lt;&lt; (0x5U) |   <span class="comment">/* Multi block/single block Select */</span></div><div class="line">                    0UL &lt;&lt; (0x4U) |   <span class="comment">/* 1 - read, 0 - write */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__enums.html#gga6d2439309c4364371d8384781c5c8ba1af02190c28807bd5fa0ad52d123e705fa">CY_SD_HOST_AUTO_CMD_12</a> &lt;&lt; (0x2U) |   <span class="comment">/* Auto CMD enable */</span></div><div class="line">                    1UL &lt;&lt; (0x1U) |   <span class="comment">/* Block count enable */</span></div><div class="line">                    1UL &lt;&lt; (0x0U) |   <span class="comment">/* DMA enable */</span></div><div class="line">                    1UL &lt;&lt; (0x8U);    <span class="comment">/* Response Interrupt Disable */</span></div><div class="line"></div><div class="line"><span class="comment">/* The DMA2 Descriptor */</span></div><div class="line">cmdDescriptor0[8] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga139636b3d397af09581d8e52eea267d1">CY_SD_HOST_ADMA_TRAN</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    (<a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a> * WR_BLOCK_NUM) &lt;&lt; CY_SD_HOST_ADMA_LEN_POS; <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor0[9] = (uint32_t)&amp;txBuff_1;    <span class="comment">/* Address */</span></div><div class="line"></div><div class="line"><span class="comment">/* The Command Descriptor for SD Mode - Write to second two blocks */</span></div><div class="line"></div><div class="line"><span class="comment">/* 32-bit Block Count */</span></div><div class="line">cmdDescriptor1[0] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor1[1] = WR_BLOCK_NUM;   <span class="comment">/* number Of Block */</span></div><div class="line"></div><div class="line"><span class="comment">/* (16-bit Block Count) + Block Size */</span></div><div class="line">cmdDescriptor1[2] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor1[3] = <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a>;    <span class="comment">/* block Size */</span></div><div class="line"></div><div class="line"><span class="comment">/* Argument */</span></div><div class="line">cmdDescriptor1[4] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor1[5] = wrAddress2;    <span class="comment">/* Write Address 2 */</span></div><div class="line"></div><div class="line"><span class="comment">/* Command + Transfer Mode */</span></div><div class="line">cmdDescriptor1[6] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor1[7] = 25UL &lt;&lt; (16U + 0x8U) |                 <span class="comment">/* Command Index - CMD25 */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x5U) |                   <span class="comment">/* Data Present Select */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x4U) |                   <span class="comment">/* Index Check Enable */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x3U) |                   <span class="comment">/* CRC Check Enable */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__enums.html#gga92601f3f191b87c5c9e43dfe08f19b06a061fb769dd73cbf0294d88d8d1e19407">CY_SD_HOST_RESPONSE_LEN_48</a> &lt;&lt; (16U + 0x0U) | <span class="comment">/* Response Type Select */</span></div><div class="line">                    1UL &lt;&lt; (0x5U) |   <span class="comment">/* Multi block/single block Select */</span></div><div class="line">                    0UL &lt;&lt; (0x4U) |   <span class="comment">/* 1 - read, 0 - write */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__enums.html#gga6d2439309c4364371d8384781c5c8ba1af02190c28807bd5fa0ad52d123e705fa">CY_SD_HOST_AUTO_CMD_12</a> &lt;&lt; (0x2U) |   <span class="comment">/* Auto CMD enable */</span></div><div class="line">                    1UL &lt;&lt; (0x1U) |   <span class="comment">/* Block count enable */</span></div><div class="line">                    1UL &lt;&lt; (0x0U) |   <span class="comment">/* DMA enable */</span></div><div class="line">                    1UL &lt;&lt; (0x8U);    <span class="comment">/* Response Interrupt Disable */</span></div><div class="line"></div><div class="line"><span class="comment">/* The DMA2 Descriptor */</span></div><div class="line">cmdDescriptor1[8] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga139636b3d397af09581d8e52eea267d1">CY_SD_HOST_ADMA_TRAN</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    (<a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a> * WR_BLOCK_NUM) &lt;&lt; CY_SD_HOST_ADMA_LEN_POS; <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor1[9] = (uint32_t)&amp;txBuff_2;    <span class="comment">/* Address */</span></div><div class="line"></div><div class="line"><span class="comment">/* The Command Descriptor for SD Mode - Read all four blocks */</span></div><div class="line"></div><div class="line"><span class="comment">/* 32-bit Block Count */</span></div><div class="line">cmdDescriptor2[0] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor2[1] = RD_BLOCK_NUM;   <span class="comment">/* number Of Block */</span></div><div class="line"></div><div class="line"><span class="comment">/* (16-bit Block Count) + Block Size */</span></div><div class="line">cmdDescriptor2[2] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor2[3] = <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a>;    <span class="comment">/* block Size */</span></div><div class="line"></div><div class="line"><span class="comment">/* Argument */</span></div><div class="line">cmdDescriptor2[4] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor2[5] = wrRdAddress;    <span class="comment">/* Read address */</span></div><div class="line"></div><div class="line"><span class="comment">/* Command + Transfer Mode */</span></div><div class="line">cmdDescriptor2[6] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaabfaa15e95d13ce6d6f01ed1bea6403d">CY_SD_HOST_ADMA3_CMD</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9f9c386bd495e1fce384127d3275b8ca">CY_SD_HOST_ADMA_LEN_POS</a>;         <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor2[7] = 18UL &lt;&lt; (16U + 0x8U) |                 <span class="comment">/* Command Index - CMD18 */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x5U) |                   <span class="comment">/* Data Present Select */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x4U) |                   <span class="comment">/* Index Check Enable */</span></div><div class="line">                    1UL &lt;&lt; (16U + 0x3U) |                   <span class="comment">/* CRC Check Enable */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__enums.html#gga92601f3f191b87c5c9e43dfe08f19b06a061fb769dd73cbf0294d88d8d1e19407">CY_SD_HOST_RESPONSE_LEN_48</a> &lt;&lt; (16U + 0x0U) | <span class="comment">/* Response Type Select */</span></div><div class="line">                    1UL &lt;&lt; (0x5U) |   <span class="comment">/* Multi block/single block Select */</span></div><div class="line">                    1UL &lt;&lt; (0x4U) |   <span class="comment">/* 1 - read, 0 - write */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__enums.html#gga6d2439309c4364371d8384781c5c8ba1af02190c28807bd5fa0ad52d123e705fa">CY_SD_HOST_AUTO_CMD_12</a> &lt;&lt; (0x2U) |   <span class="comment">/* Auto CMD enable */</span></div><div class="line">                    1UL &lt;&lt; (0x1U) |   <span class="comment">/* Block count enable */</span></div><div class="line">                    1UL &lt;&lt; (0x0U) |   <span class="comment">/* DMA enable */</span></div><div class="line">                    1UL &lt;&lt; (0x8U);    <span class="comment">/* Response Interrupt Disable */</span></div><div class="line"></div><div class="line"><span class="comment">/* The DMA2 Descriptor */</span></div><div class="line">cmdDescriptor2[8] = 1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga9093dc85b73c877c5ee6520c0d11f5f8">CY_SD_HOST_ADMA_ATTR_VALID_POS</a> | <span class="comment">/* Attr Valid */</span></div><div class="line">                    1UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga3cc1f13039d7d8af9cbfaa564a020fb0">CY_SD_HOST_ADMA_ATTR_END_POS</a> |   <span class="comment">/* Attr End */</span></div><div class="line">                    0UL &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gacf618278189cb5512c296ffa9ed6ad45">CY_SD_HOST_ADMA_ATTR_INT_POS</a> |   <span class="comment">/* Attr Int */</span></div><div class="line">                    <a class="code" href="group__group__sd__host__macros__general__purpose.html#ga139636b3d397af09581d8e52eea267d1">CY_SD_HOST_ADMA_TRAN</a> &lt;&lt; <a class="code" href="group__group__sd__host__macros__general__purpose.html#gaf3aaee64fb2fe72750694dda06acabd4">CY_SD_HOST_ADMA_ACT_POS</a> |</div><div class="line">                    (<a class="code" href="group__group__sd__host__macros__general__purpose.html#ga682e53edfbf01b007cb79d23659b00c7">CY_SD_HOST_BLOCK_SIZE</a> * RD_BLOCK_NUM) &lt;&lt; CY_SD_HOST_ADMA_LEN_POS; <span class="comment">/* Len */</span></div><div class="line">cmdDescriptor2[9] = (uint32_t)&amp;rxBuff;    <span class="comment">/* Address */</span></div><div class="line"></div><div class="line"><span class="comment">/* Initialize ADMA3 Data Transfer */</span></div><div class="line">status = <a class="code" href="group__group__sd__host__low__level__functions.html#ga0bc6396147a2b2aa4915a2d1ef3677c1">Cy_SD_Host_InitDataTransfer</a>(SDHC1, &amp;dataConfig);</div><div class="line"></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__sd__host__enums.html#ggabbf5bb6a131cd8b9c529b7e36b35fe23a4e18e8a352565d91021540b73af0d545">CY_SD_HOST_SUCCESS</a> == status)</div><div class="line">{</div><div class="line">    <span class="keywordflow">while</span> ((<a class="code" href="group__group__sd__host__macros__events.html#gac8e73e3d93e68fd372ea1608f9d3ac7e">CY_SD_HOST_XFER_COMPLETE</a> != (<a class="code" href="group__group__sd__host__interrupt__functions.html#gad4a09951afc276a483c93e5e158528f3">Cy_SD_Host_GetNormalInterruptStatus</a>(SDHC1) &amp; <a class="code" href="group__group__sd__host__macros__events.html#gac8e73e3d93e68fd372ea1608f9d3ac7e">CY_SD_HOST_XFER_COMPLETE</a>)) &amp;&amp; (!<a class="code" href="group__group__sd__host__interrupt__functions.html#ga41fa86242b7f84442e589055d3130f03">Cy_SD_Host_GetErrorInterruptStatus</a>(SDHC1)))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Wait for the data-transaction complete event. */</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">/* Clear the data-transaction complete event. */</span></div><div class="line">    <a class="code" href="group__group__sd__host__interrupt__functions.html#ga95975e199a0669a600e2fe5ada69b892">Cy_SD_Host_ClearNormalInterruptStatus</a>(SDHC1, CY_SD_HOST_XFER_COMPLETE);</div><div class="line">}</div></div><!-- fragment --> <h2><a class="anchor" id="group_sd_host_emmc_card_mode"></a>
eMMC Card Operation</h2>
<p>eMMC cards use the same API for writing and reading data. Additionally, eMMC requires configuring GPIO pins for DAT signals in 8-bit mode and card_emmc_reset_n pin if needed. The emmc member of <a class="el" href="structcy__stc__sd__host__init__config__t.html">cy_stc_sd_host_init_config_t</a> structure must be set to "true".</p>
<h2><a class="anchor" id="group_sd_host_sdio_combo_card_mode"></a>
eMMC SDIO or Combo Card Operation</h2>
<p><a class="el" href="group__group__sd__host__high__level__functions.html#ga9d72dcc2426210eef77fa5b95eefb986">Cy_SD_Host_InitCard()</a> initializes all types of cards and automatically detects the card type: SD, SDIO or Combo card. SDIO cards have their input-output (I/O) functions that can be controlled using the GPIO driver. Combo Cards can use both I/O and memory API.</p>
<h1><a class="anchor" id="group_sd_host_lp"></a>
Low Power Support</h1>
<p>The SD Host does not operate in Hibernate and Deep Sleep modes but it can automatically continue write/read operation after restoring from Deep Sleep mode. SD CLK must be disabled before going to Deep Sleep mode and can be enabled after wake up from Deep Sleep mode. To reduce the power consumption in Active mode, the user can stop the clock of the SD bus but the following interrupts can be allowed: Card Insert, Card Removal and SDIO Interrupt.</p>
<h1><a class="anchor" id="group_sd_host_remove_insert"></a>
SD Card Removal and Insertion</h1>
<p>SD card removal or insertion can be detected by calling <a class="el" href="group__group__sd__host__interrupt__functions.html#gad4a09951afc276a483c93e5e158528f3">Cy_SD_Host_GetNormalInterruptStatus</a> which returns the card removal or card insertion events (CY_SD_HOST_CARD_REMOVAL or CY_SD_HOST_CARD_INSERTION bits). These events should be reset using <a class="el" href="group__group__sd__host__interrupt__functions.html#ga95975e199a0669a600e2fe5ada69b892">Cy_SD_Host_ClearNormalInterruptStatus</a> when they occur. When the card is removed, the SDHC block disables the CMD/DAT output. It is recommended to set DAT pins to the Digital High-Z (CY_GPIO_DM_HIGHZ) drive mode when card removal is detected. This can be doing using the GPIO driver. When the card is inserted, the SDHC block automatically disables the card power and clock. After card insertion, the user should set the DAT pins drive mode back to Strong Drive, Input buffer on (CY_GPIO_DM_STRONG), and then call <a class="el" href="group__group__sd__host__high__level__functions.html#ga9d72dcc2426210eef77fa5b95eefb986">Cy_SD_Host_InitCard</a>. </p><dl class="section note"><dt>Note</dt><dd>If CARD_INTERRUPT is enabled and DAT pins are not set to Digital High-Z drive mode then the interrupt will continuously trigger because the DAT1 line is driven low upon card re-insertion. The user will have to detect the card removal in the ISR handler, apply the power to the card using <a class="el" href="group__group__sd__host__low__level__functions.html#ga89cf0f720dca3e57244dbb736efd0736">Cy_SD_Host_EnableCardVoltage</a>, set to the DAT pins drive mode to the Digital High-Z (CY_GPIO_DM_HIGHZ) and clear CY_SD_HOST_CARD_INTERRUPT bit using <a class="el" href="group__group__sd__host__interrupt__functions.html#ga95975e199a0669a600e2fe5ada69b892">Cy_SD_Host_ClearNormalInterruptStatus</a>.</dd></dl>
<h1><a class="anchor" id="group_sd_host_low_voltage_signaling"></a>
Low Voltage Signaling</h1>
<p>When lowVoltageSignaling is true, the SD Host driver sets UHS-I mode during the card initialization. The SD Host driver always starts talking to the card at 3.3V and then later switches to 1.8V. There is no internal regulator in the PSoC 6 to change SD signals from 3.3V to 1.8V. Thus, an external regulator is needed for the VDDIO of the PSoC device to provide the ability to go from 3.3V to 1.8V. The SD Host driver sets the io_volt_sel pin to high which is used to control the external regulator. </p><div class="image">
<img src="sd_host_low_voltage_signaling.png" alt="sd_host_low_voltage_signaling.png"/>
</div>
<h1><a class="anchor" id="group_sd_host_more_information"></a>
More Information</h1>
<p>Refer to the appropriate device technical reference manual (TRM) for a detailed description of the registers.</p>
<h1><a class="anchor" id="group_sd_host_Changelog"></a>
Changelog</h1>
<table class="doxtable">
<tr>
<th>Version</th><th>Changes</th><th>Reason for Change </th></tr>
<tr>
<td>2.40 </td><td>Updated API <a class="el" href="group__group__sd__host__high__level__functions.html#ga651eeea3b4c0a433db932db34ba7a222">Cy_SD_Host_Read</a>, <a class="el" href="group__group__sd__host__high__level__functions.html#gaacf4fbad1af632a2b7fe82980b15e8ae">Cy_SD_Host_Write</a>. </td><td>Bug Fixes.  </td></tr>
<tr>
<td>2.30 </td><td>Updated APIs <a class="el" href="group__group__sd__host__high__level__functions.html#ga651eeea3b4c0a433db932db34ba7a222">Cy_SD_Host_Read</a> and <a class="el" href="group__group__sd__host__high__level__functions.html#gaacf4fbad1af632a2b7fe82980b15e8ae">Cy_SD_Host_Write</a>. Updated API <a class="el" href="group__group__sd__host__low__level__functions.html#ga06ae777b53c8bcc0eeab12a7302af3be">Cy_SD_Host_DeepSleepCallback</a> for multiple SDHC instances support. Added new parameter to <a class="el" href="structcy__stc__sd__host__context__t.html">cy_stc_sd_host_context_t</a> </td><td>Defect fixing.  </td></tr>
<tr>
<td>2.20 </td><td>Updated API <a class="el" href="group__group__sd__host__low__level__functions.html#ga0bc6396147a2b2aa4915a2d1ef3677c1">Cy_SD_Host_InitDataTransfer</a> to check for CMD/DATA line BUSY status. Updated API <a class="el" href="group__group__sd__host__low__level__functions.html#ga06ae777b53c8bcc0eeab12a7302af3be">Cy_SD_Host_DeepSleepCallback</a> to support SW retention after deep sleep in CAT1C devices.  </td><td>Defect fixing.  </td></tr>
<tr>
<td>2.10 </td><td>Updated the behaviour of <a class="el" href="group__group__sd__host__low__level__functions.html#gab0b3e43c54a84f9261815171dc97f6dd">Cy_SD_Host_AbortTransfer</a> function to check the R1B response. Minor documentation updates. </td><td>Defect fixing. Documentation enhancement.  </td></tr>
<tr>
<td>2.0 </td><td>Added support for DDR50 mode and modified <a class="el" href="group__group__sd__host__high__level__functions.html#ga9d72dcc2426210eef77fa5b95eefb986" title="Initializes a card if it is connected. ">Cy_SD_Host_InitCard()</a> API to set highest possible bus speed mode. Minor documentation updates. </td><td>New feature implementation and documentation enhancement.  </td></tr>
<tr>
<td>1.90 </td><td>Fixed the <a class="el" href="group__group__sd__host__low__level__functions.html#ga602f69704f064f99daf947c1af04318b" title="Issues the software reset command to the SD card. ">Cy_SD_Host_SoftwareReset()</a> function behaviour. Now it waits until corresponding reset bit gets cleared by SDHC IP block. </td><td>Defect fixing.  </td></tr>
<tr>
<td>1.80 </td><td>Added an internal function. </td><td>Code efficiency enhancement.  </td></tr>
<tr>
<td>1.70 </td><td>Allow SDIO Card initialization through <a class="el" href="group__group__sd__host__high__level__functions.html#ga9d72dcc2426210eef77fa5b95eefb986" title="Initializes a card if it is connected. ">Cy_SD_Host_InitCard()</a> API. Added new API <a class="el" href="group__group__sd__host__low__level__functions.html#ga6f59baa83f0e65ea417e755fe6a105e3" title="Returns the Block count in SD/eMMC Card. ">Cy_SD_Host_GetBlockCount()</a>.  </td><td>Code enhancement, minor defect fixing.  </td></tr>
<tr>
<td>1.60 </td><td>Fixed/Documented MISRA 2012 violations. </td><td>MISRA 2012 compliance.  </td></tr>
<tr>
<td>1.50.1 </td><td>Minor documentation updates. </td><td>Documentation enhancement.  </td></tr>
<tr>
<td>1.50 </td><td>The default value of the SD-clock rump-up time during a wakeup from Deep Sleep is reduced to 1 us, for details, see <a class="el" href="group__group__sd__host__low__level__functions.html#ga06ae777b53c8bcc0eeab12a7302af3be">Cy_SD_Host_DeepSleepCallback</a> description. </td><td>Optimization for cases of specific wakeup timing requirements.  </td></tr>
<tr>
<td>1.40 </td><td>Added a possibility to customize the SD-clock rump-up time during a wakeup from Deep Sleep, for details, see <a class="el" href="group__group__sd__host__low__level__functions.html#ga06ae777b53c8bcc0eeab12a7302af3be">Cy_SD_Host_DeepSleepCallback</a> description. </td><td>Workaround for cases of specific wakeup timing requirements.  </td></tr>
<tr>
<td>1.30 </td><td>The internal function implementation is changed. </td><td>Code efficiency enhancement, minor defect fixing.  </td></tr>
<tr>
<td rowspan="2">1.20 </td><td>Added the <a class="el" href="group__group__sd__host__low__level__functions.html#ga06ae777b53c8bcc0eeab12a7302af3be" title="This function handles the transition of the SD Host into and out of Deep Sleep mode. ">Cy_SD_Host_DeepSleepCallback()</a> function. </td><td>Driver maintenance.  </td></tr>
<tr>
<td>Fixed the <a class="el" href="group__group__sd__host__low__level__functions.html#ga19426622f0a7b92579030e0c954f4bc9" title="Returns the Card Specific Data (CSD) register contents. ">Cy_SD_Host_GetCsd()</a> function behaviour. Now the <a class="el" href="structcy__stc__sd__host__context__t.html#aedeba1076cd1d558b97df8503d632890" title="The SD card maximum number of the sectors. ">cy_stc_sd_host_context_t::maxSectorNum</a> is being updated correctly </td><td>Defect fixing.  </td></tr>
<tr>
<td>1.10.1 </td><td>Documentation of the MISRA rule violation. </td><td>MISRA compliance.  </td></tr>
<tr>
<td>1.10 </td><td>The PLL and CLK disable sequence in <a class="el" href="group__group__sd__host__low__level__functions.html#gae619bd70f081a40c7e213712561d3dcc">Cy_SD_Host_DisableSdClk()</a> is changed to disable CLK first.<br />
 The Low-Power Support section is updated with additional information about disabling CLK.<br />
 The context initialization in <a class="el" href="group__group__sd__host__low__level__functions.html#ga7e46a2df218aebc23faac7acdf5260da">Cy_SD_Host_Init()</a> is corrected.<br />
 Updated the Write/Read sequence in <a class="el" href="group__group__sd__host__high__level__functions.html#ga651eeea3b4c0a433db932db34ba7a222">Cy_SD_Host_Read()</a> and <a class="el" href="group__group__sd__host__high__level__functions.html#gaacf4fbad1af632a2b7fe82980b15e8ae">functions</a> for non DMA mode.<br />
  </td><td>Defect fixing.  </td></tr>
<tr>
<td>1.0 </td><td>The initial version. </td><td></td></tr>
</table>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__sd__host__macros"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sd__host__macros.html">Macros</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__sd__host__functions"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sd__host__functions.html">Functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__sd__host__data__structures"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sd__host__data__structures.html">Data Structures</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__sd__host__enums"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sd__host__enums.html">Enumerated Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
